package com.qianli.cashmama.trade.client.trade.request;

import com.fqgj.common.api.ParamsObject;
import com.fqgj.exception.common.ApplicationException;
import com.qianli.cashmama.trade.common.enums.TradeCloseTypeEnum;
import org.apache.commons.lang.StringUtils;

/**
 * Created with IntelliJ IDEA.
 * User: sm
 * Date: 2017/7/27
 * Time: 下午5:43
 */
public class CloseTradeRequest extends ParamsObject {

    private String tradeNo;

    private TradeCloseTypeEnum closeCode;

    private String info;

    private String adminCode;

    @Override
    public void validate() {
        if (StringUtils.isEmpty(tradeNo) || closeCode == null) {
            throw new ApplicationException("The transaction number and closing code cannot be empty");
        }
    }

    public String getAdminCode() {
        return adminCode;
    }

    public CloseTradeRequest setAdminCode(String adminCode) {
        this.adminCode = adminCode;
        return this;
    }

    public String getTradeNo() {
        return tradeNo;
    }

    public CloseTradeRequest setTradeNo(String tradeNo) {
        this.tradeNo = tradeNo;
        return this;
    }

    public TradeCloseTypeEnum getCloseCode() {
        return closeCode;
    }

    public CloseTradeRequest setCloseCode(TradeCloseTypeEnum closeCode) {
        this.closeCode = closeCode;
        return this;
    }

    public String getInfo() {
        return info;
    }

    public CloseTradeRequest setInfo(String info) {
        this.info = info;
        return this;
    }
}
